Sharing resources in a networked computer system, such as processors, computer memories, network bandwidth and data storage facilities, among clients, e.g., virtual machines (VMs), running on the system can increase efficiency by reducing maintenance and operating costs, allowing flexibility with respect to individual resource usage, and simplifying resource management. With respect to shared storage, the benefits include data consolidation, universal access to data, ease of storage management, and support for live migration of virtualized environments. Thus, efficiently and effectively managing the shared resources for the clients running in the networked computer system is an important task to ensure that the clients are operating at their desired levels.
In some conventional virtualized infrastructures, an administrator is allowed to specify affinity-type rules for various resources. As an example, a client-client affinity rule ensures that all clients in a specified group will be placed on the same host computer. As another example, a client-client anti-affinity rule ensures that clients in a specified group will be placed on different host computers so that no two clients are placed on the same host computer. As another example, a client-host affinity rule ensures that specified clients are only placed in specified host computers. As another example, a client-host anti-affinity rule ensures that specified clients are never placed in any of specified host computers. However, since there can be hundreds or even thousands of clients running in some virtualized infrastructures, manually creating affinity-type rules for some of these clients can be overwhelming. In addition, since conditions or situations may change over time, established affinity-type rules may need to be repeatedly modified in response to changes in conditions or situations, which may require significant amount of manual operations.